library(ape)

X11()

tr <- rcoal(30)
x <- rnorm(30)


plot(tr, x.lim = 5) # <- adjust x.lim
offset <- 4 # <- adjust offset
barplot(c(NA, x), add = TRUE, horiz = TRUE, space = 0, offset = offset, axes = FALSE)
lab <- pretty(x)
axis(1, lab + offset, labels = lab)


abline(h=1:30, col = "red", lty = 3)




tr <- rtree(10)
layout(matrix(1:9, 3, 3))
par(mar = rep(0, 4))
plot(tr)
plot(tr, "c")
plot(tr, "u")
plot(tr, "p", FALSE)
plot(tr, "c", FALSE)
plot(tr, "u", FALSE)
plot(tr, "r")
plot(tr, "f")
plot(tr, "f", FALSE)



tr<-read.nexus("./py/tol2.txt")
tr2<-collapse.singles(tr)
plot(tr)

